<template>
	<view class="box">
		<view class="info_box">
			<view class="fw_box ">
				<view class="name">房屋信息</view>
				<view class="fws b_bottom">
					<view class="f_c mt">
						<view class="f_c_left">小区名称</view>
						<view>{{info.plot.name}}</view>
					</view>
					<view class="f_c mt">
						<view class="f_c_left">楼栋单元</view>
						<view><text v-if="info.floor">{{info.floor.name}}</text><text v-if="info.layer">{{info.layer.name}}</text><text v-if="info.room">{{info.room.name}}</text></view>
					</view>
					
				</view>
			</view>
			<view class="fw_box">
				<view class="name">身份信息</view>
				<view class="fws">
					<view class="f_c mt">
						<view class="f_c_left">身份</view>
						<view>{{info.groups.name}}</view>
					</view>
					<view class="f_c mt">
						<view class="f_c_left">姓名</view>
						<view>{{info.nickname}}</view>
					</view>
					<view class="f_c mt">
						<view class="f_c_left">手机号</view>
						<view>{{info.mobile}}</view>
					</view>
					<view class="f_c">
						<view class="f_c_left">性别</view>
						<view><text v-if="info.sex==1">男</text><text v-else></text></view>
					</view>
					<view class="info" v-if="info.url">
						<view>人脸图片</view>
						<view  class="img_box">
							
						<image @click="previewImage(info.url)"  :src="info.url" class="img"></image>
									
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				params:{id:'',type:2},
				info:''
			}
		},
		
		onLoad(e) {
			if(e.id){
				this.params.id=e.id;
			}
			this.getInfo();
		},
		methods:{
			previewImage(e) {
				uni.previewImage({
					urls: [e]
				});
			},
			getInfo(){
				this.$get(this.$api.aduitInfo,this.params,res=>{
					let data=res.data;
					if(data.code==1){
					  this.info=data.data;	
					}
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.f_c{
		display: flex;
		align-items: center;
	}
	.box{
		box-sizing: border-box;
		padding: 25rpx;
	}
	.info_box{
		border-radius: 15rpx;
		background-color: white;
	}
	.fw_box{
		box-sizing: border-box;
		padding: 30rpx 30rpx 0 30rpx;
	}
	.fws{
		box-sizing: border-box;
		padding: 30rpx 6rpx 30rpx 6rpx;
	}
	.b_bottom{
		border-bottom: 1rpx solid #eee;
	}
	.f_c_left{
		width: 26%;
	}
	.name{
		font-weight: bold;
	}
	.mt{
		margin-bottom: 30rpx;
	}
	.info{
		margin-top: 30rpx;
	}
	
	.img {
		width: 180rpx;
		height: 180rpx;
		margin-right: 10rpx;
		margin-top: 10rpx;
	}
</style>